package com.sui.bigdata.sml.model.model;

import com.alibaba.fastjson.JSON;
import com.sui.bigdata.sml.model.util.ModelType;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author songhaicheng
 * @date 2019/12/4 15:01
 * @description 启动的模型信息
 * @reviewer
 */
@Data
@Accessors(chain = true)
@Component
public class Model {

    private String token;
    private String hdfsPath;
    private String modelType;
    private int threadNum;
    private List<DefinedFeature> warmUpFeature;
    private int warmUpTimes;
    private int version;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    public boolean isSingleton() {
        return ModelType.getModelType(this.modelType) == ModelType.PMML;
    }

}
